package org.rslai.autotest.core.page;

import org.openqa.selenium.WebDriver;
import org.rslai.autotest.core.driver.IDriver;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 所有Helper基类
 * @author rslai
 */
public abstract class AbstractHelper {
	@Autowired
	protected IDriver iDriver;

	@Autowired
	protected Conf conf;
	
	/**
	 * 返回当前 WebDriver
	 * @return 返回WebDriver
	 */
	protected WebDriver driver() {
		return iDriver.getDriver();
	}

	/**
	 * 设置当前iDriver
	 * @param iDriver
	 */
	public void setIDriver(IDriver iDriver) {
		this.iDriver = iDriver;
	}

	/**
	 * 强制 sleep 指定秒数
	 * @param seconds 秒
	 */
	protected void sleep(double seconds) {
		org.rslai.util.time.Time.getInstance().sleep(seconds);
	}

}
